package com.main.organizationandplatformmanagement.interfaces.assembler;

import com.main.common.base.base.BaseAssembler;
import com.main.common.base.base.BaseAssemblerFactory;
import com.main.organizationandplatformmanagement.domain.organization.entity.Organization;
import com.main.organizationandplatformmanagement.interfaces.dto.AddOrganizationDTO;
import jakarta.validation.constraints.NotNull;


public class OrganizationAssembler {
    private final BaseAssembler<Organization, AddOrganizationDTO> baseAssembler;

    public OrganizationAssembler(@NotNull BaseAssemblerFactory baseAssemblerFactory) {
        this.baseAssembler = baseAssemblerFactory.getService(AddOrganizationDTO.class);
    }

    public Organization toEntity(AddOrganizationDTO OrganizationDTO) {
        Organization organization = new Organization();
        organization = baseAssembler.toEntity(OrganizationDTO, organization);
        organization.setName(OrganizationDTO.getName());
        return organization;
    }

}